<!DOCTYPE html>
<html lang="en">
  <head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="utf-8">

    <title>easy java document | easy-java </title>
    <meta name="description" content>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    

    <!-- fonts -->
    <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Ubuntu:300,400,500,600,700" rel="stylesheet">

    <!-- stylesheets -->
    <link rel="stylesheet" href="/ejdoc/style/doc.css">

    <!-- favicon -->
    <link rel="icon" href="/ejdoc/images/favicon.ico">

    

  </head>
  <body>

   <script>window.__INITIAL_STATE__ = {"page":{"title":"easy-java","path":"workflow1.html"},"data":{"navigation":{"logo":{"text":"Easy Java","type":"link","path":"index.html"},"main":[{"text":"工作流与业务流集合","type":"link","path":"wf3.html"},{"text":"一对多关联V2.0","type":"link","path":"o2m.html"}]},"navigation.yaml":"{\n  \"logo\": {\n    \"text\": \"Easy Java\",\n    \"type\": \"link\",\n    \"path\": \"index.html\"\n  },\n  \"main\": [\n    {\n        \"text\": \"如何让你的项目快人N步?\",\n        \"type\": \"link\",\n        \"path\": \"index.html\"\n    },\n    {\n        \"text\": \"起步（从无到有）\",\n        \"type\": \"link\",\n        \"path\": \"build-code.html\"\n    },\n    {\n        \"text\": \"项目演示地址\",\n        \"type\": \"link\",\n        \"path\": \"show.html\"\n    },\n    {\n        \"text\": \"安装\",\n        \"type\": \"link\",\n        \"path\": \"install.html\"\n    },\n    {\n        \"text\": \"功能介绍\",\n        \"type\": \"link\",\n        \"path\": \"function1.html\"\n    },\n    {\n        \"text\": \"动态工作流-内置表单\",\n        \"type\": \"link\",\n        \"path\": \"workflow1.html\"\n    },\n    {\n        \"text\": \"动态工作流-外置表单\",\n        \"type\": \"link\",\n        \"path\": \"workflow2.html\"\n    },\n    {\n        \"text\": \"分布式定时任务\",\n        \"type\": \"link\",\n        \"path\": \"timer.html\"\n    },\n    {\n        \"text\": \"升级日志\",\n        \"type\": \"link\",\n        \"path\": \"log-20200517.html\"\n    },\n    {\n        \"text\": \"计划\",\n        \"type\": \"link\",\n        \"path\": \"future.html\"\n    },\n    {\n        \"text\": \"有Bug及时发我完善\",\n        \"type\": \"label\"\n    }\n  ]\n}\n"},"config":{"timezone":"UTC","root":"/ejdoc/","time_format":"HH:mm:ss","theme":"../node_modules/hexo-theme-doc","theme_config":{"swagger_ui":{"version":2,"permalinks":true,"api_explorer":true,"download":"Download specification","show_extensions":false,"deep_linking":true,"display_operation_id":false,"doc_expansion":"none"},"search":{"skip":false,"background":false,"route":"/lunr.json"},"favicon":"images/favicon.ico"}}}</script>

    <div id="react-navigation-root"><div class="doc-navigation" data-reactroot><nav class="doc-navbar"><a href="/ejdoc/index.html" class="doc-navbar__logo"><img src="/ejdoc/images/logo.png" class="doc-navbar__logo__img"><span class="doc-navbar__logo__text">Easy Java</span></a><i class="dc-icon dc-icon--close dc-icon--interactive doc-sidebar-close doc-navbar__sidebar-close doc-navbar__sidebar-close--desktop"></i><i class="dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle doc-navbar__sidebar-toggle"></i></nav><nav class="doc-sidebar"><div class="doc-sidebar__vertical-menu"><i class="dc-icon dc-icon--menu dc-icon--interactive doc-sidebar-toggle doc-sidebar-toggle--primary doc-sidebar__vertical-menu__item"></i><i class="dc-icon dc-icon--search dc-icon--interactive doc-sidebar__vertical-menu__item doc-sidebar__vertical-menu__item--primary"></i></div><div class="doc-sidebar-content"><div class="doc-sidebar__search-form"></div><ul class="doc-sidebar-list"></ul></div></nav></div></div>
    <div class="doc-content">
  <div class="dc-page">
    <div class="dc-card">
      <div id="react-search-results-root"></div>
      <div id="page-content" class="doc-formatting">
        <h2 id="网页设计器"><a href="#网页设计器" class="headerlink" title="网页设计器"></a>网页设计器</h2><pre><code>发布日期：2020.05.30
在Vue中集成Activiti网页设计器，为动态工作流研发作准备工作
</code></pre><p><img src="./images/wf1.png" width="1000"><br>图1：部署界面 <br><br><img src="./images/wf2.png" width="1000"><br>图2：设计器 <br></p>
<pre><code>1，数据库中，执行工作流sql脚本
2，增加菜单项; 依次点击：基础数据管理/菜单管理/批量发布一级菜单; 使用以下json发布，自动创建“工作流管理”的完整目录，包括下面介绍的&quot;我的流&quot;、&quot;工作流设计器&quot;、&quot;我要请假&quot;等
</code></pre><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">  <span class="string">"label"</span>: <span class="string">"工作流管理"</span>,</span><br><span class="line">  <span class="string">"nameEn"</span>: <span class="string">""</span>,</span><br><span class="line">  <span class="string">"sort"</span>: 4,</span><br><span class="line">  <span class="string">"type"</span>: 0,</span><br><span class="line">  <span class="string">"url"</span>: <span class="string">""</span>,</span><br><span class="line">  <span class="string">"children"</span>: [</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"label"</span>: <span class="string">"我的流"</span>,</span><br><span class="line">      <span class="string">"nameEn"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"sort"</span>: 0,</span><br><span class="line">      <span class="string">"type"</span>: 0,</span><br><span class="line">      <span class="string">"url"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"children"</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">          <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"name"</span>: <span class="string">"待办任务"</span>,</span><br><span class="line">          <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"attributes"</span>: &#123;</span><br><span class="line">            <span class="string">"type"</span>: 0,</span><br><span class="line">            <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-waiting-task"</span>,</span><br><span class="line">            <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">          &#125;,</span><br><span class="line">          <span class="string">"id"</span>: 7479,</span><br><span class="line">          <span class="string">"label"</span>: <span class="string">"待办任务"</span>,</span><br><span class="line">          <span class="string">"nameEn"</span>: <span class="string">"TmptMyWaitingTask"</span>,</span><br><span class="line">          <span class="string">"sort"</span>: 0,</span><br><span class="line">          <span class="string">"type"</span>: 0,</span><br><span class="line">          <span class="string">"menuParentId"</span>: 7481,</span><br><span class="line">          <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-waiting-task"</span>,</span><br><span class="line">          <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"name"</span>: <span class="string">"已完成任务"</span>,</span><br><span class="line">          <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"attributes"</span>: &#123;</span><br><span class="line">            <span class="string">"type"</span>: 0,</span><br><span class="line">            <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-complete-task"</span>,</span><br><span class="line">            <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">          &#125;,</span><br><span class="line">          <span class="string">"id"</span>: 7480,</span><br><span class="line">          <span class="string">"label"</span>: <span class="string">"已完成任务"</span>,</span><br><span class="line">          <span class="string">"nameEn"</span>: <span class="string">"TmptMyComplateTask"</span>,</span><br><span class="line">          <span class="string">"sort"</span>: 1,</span><br><span class="line">          <span class="string">"type"</span>: 0,</span><br><span class="line">          <span class="string">"menuParentId"</span>: 7481,</span><br><span class="line">          <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-complete-task"</span>,</span><br><span class="line">          <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">        &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">          <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"name"</span>: <span class="string">"我发起的流程"</span>,</span><br><span class="line">          <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">          <span class="string">"attributes"</span>: &#123;</span><br><span class="line">            <span class="string">"type"</span>: 0,</span><br><span class="line">            <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-start-task"</span>,</span><br><span class="line">            <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">          &#125;,</span><br><span class="line">          <span class="string">"id"</span>: 7477,</span><br><span class="line">          <span class="string">"label"</span>: <span class="string">"我发起的流程"</span>,</span><br><span class="line">          <span class="string">"nameEn"</span>: <span class="string">"TmptMyStartTask"</span>,</span><br><span class="line">          <span class="string">"sort"</span>: 2,</span><br><span class="line">          <span class="string">"type"</span>: 0,</span><br><span class="line">          <span class="string">"menuParentId"</span>: 7481,</span><br><span class="line">          <span class="string">"url"</span>: <span class="string">"tmpt/activiti/tmpt-my-start-task"</span>,</span><br><span class="line">          <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">        &#125;</span><br><span class="line">      ],</span><br><span class="line">      <span class="string">"name"</span>: <span class="string">"我的流"</span>,</span><br><span class="line">      <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"attributes"</span>: &#123;</span><br><span class="line">        <span class="string">"type"</span>: 0,</span><br><span class="line">        <span class="string">"url"</span>: <span class="string">""</span>,</span><br><span class="line">        <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">      &#125;,</span><br><span class="line">      <span class="string">"id"</span>: 7481,</span><br><span class="line">      <span class="string">"menuParentId"</span>: 7475,</span><br><span class="line">      <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"name"</span>: <span class="string">"我要请假"</span>,</span><br><span class="line">      <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"attributes"</span>: &#123;</span><br><span class="line">        <span class="string">"type"</span>: 0,</span><br><span class="line">        <span class="string">"url"</span>: <span class="string">"Leave"</span>,</span><br><span class="line">        <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">      &#125;,</span><br><span class="line">      <span class="string">"id"</span>: 7476,</span><br><span class="line">      <span class="string">"label"</span>: <span class="string">"我要请假"</span>,</span><br><span class="line">      <span class="string">"nameEn"</span>: <span class="string">"tmpt-activiti-form"</span>,</span><br><span class="line">      <span class="string">"sort"</span>: 1,</span><br><span class="line">      <span class="string">"type"</span>: 0,</span><br><span class="line">      <span class="string">"menuParentId"</span>: 7475,</span><br><span class="line">      <span class="string">"url"</span>: <span class="string">"Leave"</span>,</span><br><span class="line">      <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">    &#125;,</span><br><span class="line">    &#123;</span><br><span class="line">      <span class="string">"auth"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"name"</span>: <span class="string">"工作流设计器"</span>,</span><br><span class="line">      <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">      <span class="string">"attributes"</span>: &#123;</span><br><span class="line">        <span class="string">"type"</span>: 0,</span><br><span class="line">        <span class="string">"url"</span>: <span class="string">"tmpt/activiti/index"</span>,</span><br><span class="line">        <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">      &#125;,</span><br><span class="line">      <span class="string">"id"</span>: 7478,</span><br><span class="line">      <span class="string">"label"</span>: <span class="string">"工作流设计器"</span>,</span><br><span class="line">      <span class="string">"nameEn"</span>: <span class="string">"ActivitiModeler"</span>,</span><br><span class="line">      <span class="string">"sort"</span>: 2,</span><br><span class="line">      <span class="string">"type"</span>: 0,</span><br><span class="line">      <span class="string">"menuParentId"</span>: 7475,</span><br><span class="line">      <span class="string">"url"</span>: <span class="string">"tmpt/activiti/index"</span>,</span><br><span class="line">      <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">    &#125;</span><br><span class="line">  ],</span><br><span class="line">  <span class="string">"name"</span>: <span class="string">"工作流管理"</span>,</span><br><span class="line">  <span class="string">"keyRandom"</span>: <span class="string">""</span>,</span><br><span class="line">  <span class="string">"attributes"</span>: &#123;</span><br><span class="line">    <span class="string">"type"</span>: 0,</span><br><span class="line">    <span class="string">"url"</span>: <span class="string">""</span>,</span><br><span class="line">    <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="string">"id"</span>: 7475,</span><br><span class="line">  <span class="string">"menuParentId"</span>: 0,</span><br><span class="line">  <span class="string">"hasDataLimit"</span>: 0</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="内置表单"><a href="#内置表单" class="headerlink" title="内置表单"></a>内置表单</h2><pre><code>以设计器中请假申请流程为例:
1，设置流程唯一标识：Leave；这个Leave很关键，添加菜单中要用；
2，点击&quot;开始流程&quot;，设置表格属性，如图3所示；
3，用户任务&quot;填写请假申请&quot;，是所有人都可以访问的，所以没有做任务派遣；
4，分别给&quot;经理审批&quot;、&quot;总监审批&quot;、&quot;人力资源审批&quot;设置任务派遣Assignee为2、3、4，代表各用户的ID或姓名，如图4所示；
5，在网关和经理、总监审批的连接箭头属性中分别设置跳转条件，比如请假天数少于等于3天，由经理审批，跳转条件设置成：${days&lt;=3}；
6，设置完成，回到部署页面，重新部署下。
</code></pre><p><img src="./images/wf-ds-form.png" width="1000"><br>图3：表单属性 <br><br><img src="./images/wf-ds-mag.png" width="1000"><br>图4：”经理审批”的任务派遣和任务表单 <br></p>
<h2 id="添加菜单"><a href="#添加菜单" class="headerlink" title="添加菜单"></a>添加菜单</h2><pre><code>看图设置，组件名称一定要是：tmpt-activiti-form, 组件链接就是内置表单时设备的唯一标识：Leave。
</code></pre><p><img src="./images/wf-menu.png" width="1000"><br>图5：添加菜单 <br></p>
<pre><code>然后在工作流管理菜单下，有个&quot;我要请假&quot;的菜单，打开如下图所示，自动加载了activiti内置表格(图3表单属性)的内容，提交后，可在&quot;我的流&quot;中看到流转情况。
</code></pre><p><img src="./images/wf-start.png" width="1000"><br>图6：我要请假 <br></p>
<h2 id="我的流"><a href="#我的流" class="headerlink" title="我的流"></a>我的流</h2><pre><code>我的流，由以下部分组成：我发起的流程、我的待办任务、我的已办任务。
我发起的流程：我提交的流程申请，比如我发起的请假申请，如下图7我发起的流程；
</code></pre><p><img src="./images/wf-list-mystart.png" width="1000"><br>图7：我发起的流程 <br><br><img src="./images/wf-list-mystart-image.png" width="1000"><br>图8：我发起的流程,当前状态 <br></p>
<pre><code>我的待办任务：
1，在流程设计时，设计了请假天数小于3天，就由经理审批，否则就总监审批，此处设置的是5天，由图8的流程图可知由总监审批；
2，使用总监的账号登录系统，zhang3的id是3。待办列表如下图所示；
3，通过审批。
4，然后流程就到了人力资源审批，人力资源和第2步一样，审批通过后，流程结束。
5，此处注意的是，我用户管理里设置的是，zhang2的id是2，代表经理； zhang3的id是3，代表总监；zhang4的id是4，代表人力资源；与流程设计器中的任务派遣各节点assignee保持一致。 
</code></pre><p><img src="./images/wf-mag-form-verify.png" width="1000"><br>图9：总监审批 <br></p>
<pre><code>我的已办任务：
1，回到请假人的登录账号，登录系统；
2，查看已办任务状态，如图10.
</code></pre><p><img src="./images/wf-over-img.png" width="1000"><br>图10：任务结束 <br></p>

        <div id="react-support-footer-root"></div>
      </div>
    </div>
  </div>
</div>

    


    

    <!-- js vendors -->
    <script src="//code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/lunr.js/2.1.0/lunr.min.js"></script>

    <!-- js source  -->
    <script src="/ejdoc/script/doc.js"></script>

    

  </body>
</html>
